package com.objetdirect.gwt.umlapi.client.emul.impl;

import com.objetdirect.gwt.umlapi.client.emul.def.Circle;
import com.objetdirect.gwt.umlapi.client.emul.def.Color;
import com.objetdirect.gwt.umlapi.client.emul.def.GraphicObject;
import com.objetdirect.gwt.umlapi.client.emul.def.ImageGfx;
import com.objetdirect.gwt.umlapi.client.emul.def.Line;
import com.objetdirect.gwt.umlapi.client.emul.def.Point;
import com.objetdirect.gwt.umlapi.client.emul.def.Rect;
import com.objetdirect.gwt.umlapi.client.emul.def.Text;
import com.objetdirect.gwt.umlapi.client.emul.def.VirtualGroup;
 

public class TatamaiGraphicObject implements GraphicObject {

	private com.objetdirect.tatami.client.gfx.GraphicObject _graphicObject = null;
	
	TatamaiGraphicObject(
			com.objetdirect.tatami.client.gfx.GraphicObject graphicObject) {
		_graphicObject = graphicObject;
	}
	
	public TatamaiGraphicObject(
			Circle circle) {
		this((com.objetdirect.tatami.client.gfx.GraphicObject)circle.getInnerObject());
	}
	 
	public TatamaiGraphicObject(ImageGfx anImageGfx) {
		this((com.objetdirect.tatami.client.gfx.GraphicObject)anImageGfx.getInnerObject());
	}

	public TatamaiGraphicObject(Line tatamiLine) {
		this((com.objetdirect.tatami.client.gfx.GraphicObject)tatamiLine.getInnerObject());
	}

	public TatamaiGraphicObject(TatamiPath tatamiPath) {
		this((com.objetdirect.tatami.client.gfx.GraphicObject)tatamiPath.getInnerObject());
	}

	public TatamaiGraphicObject(Rect tatamiRect) {
		this((com.objetdirect.tatami.client.gfx.GraphicObject)tatamiRect.getInnerObject());
	}

	public TatamaiGraphicObject(Text tatamiText) {
		this((com.objetdirect.tatami.client.gfx.GraphicObject)tatamiText.getInnerObject());
	}

	public TatamaiGraphicObject(VirtualGroup tatamiVirtualGroup) {
		this((com.objetdirect.tatami.client.gfx.GraphicObject)tatamiVirtualGroup.getInnerObject());
	}

	@Override
	public Object getInnerObject() {
		return _graphicObject;
	}
	@Override
	public void translate(int x, int y) {
		_graphicObject.translate(x, y);
		
	}
	@Override
	public void setStrokeStyle(String style) {
		_graphicObject.setStrokeStyle(style);
		
	}
	 
	@Override
	public void setOpacity(int alpha) {
		_graphicObject.setOpacity(alpha);
		
	}
	@Override
	public Color getStrokeColor() {
		return new TatamiColor(_graphicObject.getStrokeColor());
	}
	@Override
	public void setStrokeColor(Color color) {
		_graphicObject.setStrokeColor((com.objetdirect.tatami.client.gfx.Color)color.getInnerObject());
		
	}
	@Override
	public void rotate(float angle, Point point) {
		_graphicObject.rotate(angle, (com.objetdirect.tatami.client.gfx.Point)point.getInnerObject());
		
	}
	@Override
	public void setFillColor(Color convertColor) {
		_graphicObject.setFillColor((com.objetdirect.tatami.client.gfx.Color)convertColor.getInnerObject());
		
	}
	@Override
	public void moveToFront() {
		_graphicObject.moveToFront();
		
	}
	@Override
	public void moveToBack() {
		_graphicObject.moveToBack();
		
	}
	@Override
	public double getY() {
		 
		return _graphicObject.getY();
	}
	@Override
	public double getX() {
		return _graphicObject.getX();
	}
	@Override
	public GraphicObject getGroup() {
		 
		GraphicObject groupObject  = new TatamaiGraphicObject(_graphicObject.getGroup());
		return groupObject;
	}

	@Override
	public void setStroke(
			
			Color convertColor,
			int width) {
		_graphicObject.setStroke((com.objetdirect.tatami.client.gfx.Color)convertColor.getInnerObject(), width);
		
	}
}
